package com.hqyj.controller;

import com.hqyj.pojo.Cource;
import com.hqyj.service.CourceService;
import com.hqyj.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

/**
 * <p></p>
 *
 * @author : zlf
 * @date : 2020-09-02 21:47
 **/
@Controller
@RequestMapping("cource")
public class CourceController {


    @Autowired
    CourceService courceService;
    @RequestMapping("courcePage")
    public String depart(){
        return "/cource/courceList";
    }
    @RequestMapping("select")
    @ResponseBody
    public HashMap<String,Object> select(Cource cource){
        return courceService.selectDnameAndCname(cource);
    }
    @RequestMapping("courceAdd")
    @ResponseBody
    public HashMap<String,Object> courceAdd(Cource cource){
        return courceService.courceAdd(cource);
    }
    @RequestMapping("courceUpdate")
    @ResponseBody
    public HashMap<String,Object> courceUpdate(Cource cource){
        return courceService.courceUpdat(cource);
    }
    @RequestMapping("courceDel")
    @ResponseBody
    public HashMap<String,Object> courceDel(Cource cource){
        return courceService.courceDel(cource);
    }
}
